# -*- coding: utf-8 -*-
from django.db import models
import datetime


TIPO_PESSOA = (('1','Aluno'),('2','Professor'))

class Turma(models.Model):
    nome = models.CharField("Turma", max_length=20)
    def __unicode__(self):
        return self.nome

class Pessoa(models.Model):
    nome = models.CharField(max_length=70)
    endereco = models.CharField(max_length=70)
    dataaniversario = models.DateField()
    telefone = models.CharField(max_length=8)
    email = models.EmailField(max_length=50, blank=True, null=True)
    tipo = models.CharField(max_length=1, choices=TIPO_PESSOA)
    nomeTurma = models.ForeignKey(Turma, blank=True, null=True, related_name="clientes")
    def __unicode__(self):
        return self.nome